$(document).ready(function(){
	// 初始化时间
	 set_time($("#clock"));
});
function set_time(jclock){
	   if(jclock.length !=0){
				var options = {
					format: '%Y年%m月%d日 %A %H:%M:%S'
				};
				jclock.jclock(options);
	   }
}

(function(){
	// top button 
	var self = {
		back:$("#back"),
		go:$("#go"),
		refresh:$("#refresh"),
		exit:$("#exit"),
		index:$("#index"),
		individual:$("#individual")
	};

	$.extend(self,{
		_init:function(){
		   self._initEvent();
		},
		_initEvent:function(){
			self.back.bind('click',function(){
				window.history.go(-1);
			});
			self.go.bind('click',function(){
				window.history.go(1);
			});
			self.refresh.bind('click',function(){
				window.parent.frames["leftFrame"].location.reload();
				window.parent.frames["centerFrame"].location.reload();
				window.parent.frames["topFrame"].location.reload();
			});
			
			self.index.bind('click',function(){
				parent.location.href='../main.jsp';
			});
			
			self.exit.bind('click',function(){
				if(window.confirm("您确定要退出吗？")){
					parent.location.href='../user/loginAction!logout.do';
				}
			});
			
			self.individual.bind('click',function(){
				window.parent.frames["centerFrame"].location.href='../system/userAction!getChangePassword.do';
			});
		}
	});
	self._init();
})(jQuery);